﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using HZ.Supervise.Model;

namespace HZ.Supervise.Web.Message
{
    public partial class MessageCheckedDetail : System.Web.UI.Page
    {
        string id;
        IBLL.IBLL_MessageTypeDetail ibllMessage = new BLL.BLL_MessageTypeDetail();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ViewState["query"] = URLUtil.GetSuperviseQueryFromURL(Request);
                SuperviseQuery sq = (SuperviseQuery)ViewState["query"];
                id = sq.MessageId;
                BindData();
            }
        }
        void BindData()
        {
            if (id != null)
            {
                int t = 0;
                Model.Message message = new HZ.Supervise.Model.Message();
                message.Id = id;
                message.CreatTime = null;
                gvwMessageCheckedDetailList.DataSource = ibllMessage.GetMessageOrderDetail(id, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out t);
                gvwMessageCheckedDetailList.DataBind();
                AspNetPager1.RecordCount = t;
            }
        }
        protected void btnExit_Click(object sender, EventArgs e)
        {
            Response.Redirect("MessageCheckedList.aspx");
        }
        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            ViewState["query"] = URLUtil.GetSuperviseQueryFromURL(Request);
            SuperviseQuery sq = (SuperviseQuery)ViewState["query"];
            id = sq.MessageId;
            BindData();
        }
    }
}
